<template>
  <div>
    <top></top>
    <router-view></router-view>
  </div>



</template>

<script>
  import top from "./components/common/top";
  import banner from "./components/common/banner";
  import login from "./components/common/login";
export default {
  name: 'App',
  data:function () {
      return {
        username: ''
      }
  },
  components: {
    top
  },
  methods: {
      say: function () {
          alert('????')
      }

  },
  mounted() {
      // 通过cookie获取用户名
      this.username = this.$cookie.get('username')
      window.addEventListener('beforeunload', e => this.say() );
  },
  destroyed() {
    this.$axios.post('delete_session/')
  },

}

</script>

<style>

</style>
